package ModelImplementation

import "time"

type BiweeklySchedule struct {
}

func (b *BiweeklySchedule) IsPayDate(payDate time.Time) bool {
	firstPayableFriday := time.Date(2001, 11, 9, 0, 0, 0, 0, time.Local)
	ts := payDate.Sub(firstPayableFriday)

	var daysSinceFirstPayableFriday int = int(ts.Hours()) //有误
	return (daysSinceFirstPayableFriday % 14) == 0
}

func (b *BiweeklySchedule) GetPayPeriodStartDate(payPeriodEndDate time.Time) time.Time {
	return payPeriodEndDate.Add(-13)
}
